{% extends "oauth2_provider/base.html" %}


{% load i18n %}
{% block content %}
<style>
    .submit {
    }
    .allow-btn {
        background-color: #44b549;
        border-radius: 2px;
        color: #fff;
        cursor: pointer;
        width: 80px;
        font-size: 14px;
        line-height: 18px;
        height: 40px;
    }
    .cancel-btn {
        background-color: #999;
        border-radius: 2px;
        color: #fff;
        cursor: pointer;
        width: 80px;
        font-size: 14px;
        line-height: 18px;
        height: 40px;
    }

</style>
    <div class="block-center">
        {% if not error %}
            <form id="authorizationForm" method="post">
                <h3 class="block-center-heading">{% trans "授权" %}: {{ application.name }}?</h3>
                {% csrf_token %}

                {% for field in form %}
                    {% if field.is_hidden %}
                        {{ field }}
                    {% endif %}
                {% endfor %}

                <p>{% trans "将允许应用进行以下操作" %}</p>
                <ul>
                    {% for scope in scopes_descriptions %}
                        <li style="list-style: square inside;">{{ scope }}</li>
                    {% endfor %}
                </ul>

                {{ form.errors }}
                {{ form.non_field_errors }}

                <div class="control-group">
                    <div class="controls">
                        <input type="submit" class="cancel-btn" style="width:82px;" value="取消"/>
                        <input type="submit" class="allow-btn" style="width:82px;" name="allow" value="授权"/>
                    </div>
                </div>
            </form>

        {% else %}
            <h2>Error: {{ error.error }}</h2>
            <p>{{ error.description }}</p>
        {% endif %}
    </div>
{% endblock %}
